#pragma once

#include <glm/glm.hpp>

namespace kanon
{
    class Camera2d
    {
    private:
        glm::vec2 pos;
        float scale;
        float rotation;

        uint32_t windowWidth;
        uint32_t windowHeight;

        float xmin;
        float xmax;
        float ymin;
        float ymax;

    public:
        Camera2d();

        // set fov wrt window size
        void SetWindowSize(uint32_t windowWidth, uint32_t windowHeight);

        void Move(float dx, float dy);
        void Rotate(float dt);
        void Zoom(float dz);

        glm::mat4 GetViewMatrix() const;
        glm::mat4 GetProjectionMatrix(uint32_t windowWidth = 1080, uint32_t windowHeight = 720) const;

        glm::vec2 ScreenToWorld(float x, float y);
        glm::vec2 WorldToScreen(float x, float y);
    };
}
